/**
 * FigmaMCPWorkflow 样式模板
 * 组件基础样式结构
 */

.root {
  // 基础布局
  position: relative;
  box-sizing: border-box;
  width: 100%;

  // 默认样式
  background-color: #ffffff;
  border-radius: 4px;
  transition: all 0.3s ease;

  // 隐藏状态（必需）
  &.hidden {
    display: none !important;
  }

  // 编辑态样式
  &.editMode {
    pointer-events: none;

    &::after {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      border: 1px dashed #1890ff;
      pointer-events: none;
      z-index: 1000;
    }
  }

  // 响应式布局
  @media (max-width: 768px) {
    padding: 12px;
  }
}

// 头部区域
.header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;

  .title {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.5;
    color: #333333;
  }

  .subTitle {
    margin: 4px 0 0;
    font-size: 14px;
    color: #666666;
    line-height: 1.5;
  }
}

// 内容区域
.content {
  position: relative;

  .description {
    margin-bottom: 16px;
    font-size: 14px;
    color: #666666;
    line-height: 1.6;
  }

  .mainContent {
    min-height: 200px;

    // 占位符样式
    .placeholder {
      display: flex;
      align-items: center;
      justify-content: center;
      height: 200px;
      background-color: #fafafa;
      border: 1px dashed #d9d9d9;
      border-radius: 4px;
      color: #999999;
      font-size: 14px;

      pre {
        margin: 0;
        padding: 16px;
        max-width: 100%;
        overflow: auto;
        font-size: 12px;
        font-family: 'Monaco', 'Menlo', monospace;
      }
    }
  }
}

// Logo样式
.logo {
  position: absolute;
  top: 16px;
  right: 16px;
  max-width: 120px;
  max-height: 40px;
  object-fit: contain;
}

// 图表容器（如需要）
.chartContainer {
  position: relative;
  width: 100%;
  height: 400px;
  padding: 16px;

  // ECharts容器
  :global {
    .echarts-for-react {
      width: 100% !important;
      height: 100% !important;
    }
  }
}

// 表格样式（如需要）
.tableContainer {
  overflow-x: auto;

  table {
    width: 100%;
    border-collapse: collapse;

    thead {
      background-color: #fafafa;

      th {
        padding: 12px;
        text-align: left;
        font-weight: 500;
        border-bottom: 2px solid #f0f0f0;
      }
    }

    tbody {
      tr {
        &:hover {
          background-color: #fafafa;
        }

        td {
          padding: 12px;
          border-bottom: 1px solid #f0f0f0;
        }
      }
    }
  }
}

// 列表样式（如需要）
.listContainer {
  .listItem {
    padding: 12px;
    margin-bottom: 8px;
    background-color: #fafafa;
    border-radius: 4px;
    transition: background-color 0.3s;

    &:hover {
      background-color: #f0f0f0;
    }

    &:last-child {
      margin-bottom: 0;
    }
  }
}

// 加载状态
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;

  &::after {
    content: 'Loading...';
    color: #999999;
    font-size: 14px;
  }
}

// 空状态
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: #999999;

  .emptyIcon {
    font-size: 48px;
    margin-bottom: 16px;
  }

  .emptyText {
    font-size: 14px;
  }
}

// 错误状态
.error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: #ff4d4f;

  .errorIcon {
    margin-right: 8px;
    font-size: 16px;
  }

  .errorText {
    font-size: 14px;
  }
}

// 动画效果
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animated {
  animation: fadeIn 0.5s ease-out;
}

// 工具类
.textLeft { text-align: left; }
.textCenter { text-align: center; }
.textRight { text-align: right; }

.mt8 { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.mt24 { margin-top: 24px; }

.mb8 { margin-bottom: 8px; }
.mb16 { margin-bottom: 16px; }
.mb24 { margin-bottom: 24px; }

.p8 { padding: 8px; }
.p16 { padding: 16px; }
.p24 { padding: 24px; }